import 'package:flutter/foundation.dart';

class Store with ChangeNotifier, DiagnosticableTreeMixin {

  String? _token;

  Store();

  /// 是否登录
  bool get isLogin {
    if (this._token == null) {
      return false;
    }
    return this._token!.isNotEmpty;
  }

  /// 设置token
  set token(String token){
    this._token = token;
    this.notifyListeners();
  }

  @override
  void debugFillProperties(DiagnosticPropertiesBuilder properties) {
    super.debugFillProperties(properties);
    properties.add(StringProperty('_token', _token));
    properties.add(FlagProperty('isLogin', value: this.isLogin));
  }
}